<script setup>
const props = defineProps({
  car: String,
  money: Number
})

console.log('---props---', props)

// defineEmits用来定义自定义事件
const emit = defineEmits(['changeMoney'])

const discount = () => {
  // vue this.$emit('自定义事件名字',值)
  emit('changeMoney', 10)
}
</script>

<template>
  <div class="">
    Child
    <p>car is {{ car }} money is {{ money }}</p>
    <p>
      <button @click="discount">打折</button>
    </p>
  </div>
</template>

<style scoped></style>
